package org.example.llogger.Controller;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logger")
public class LoggerController {

    private static Logger logger = LoggerFactory.getLogger("LoggerController");
    @RequestMapping("/print")
    public String print(){
        logger.info("使用日志对象来打印日志");
        System.out.println("使用sout来打印日志");
        return "success";
    }

    @RequestMapping("/level")
    public String levelPrint(){
        logger.trace("======trace级别的日志=====");
        logger.debug("======debug级别的日志=====");
        logger.info("======info级别的日志=====");
        logger.warn("======warn级别的日志=====");
        logger.error("======error级别的日志=====");
        return "success";
    }
}
